<template>
  <app-container>
    <app-block>
      <zm-tabs :list="tabList" v-model="tabValue" name-key="value"></zm-tabs>
      <div class="pt20">
        <zm-table-data v-if="tabValue === '2'" :data="tableData" :columns="columns" :fetch="loadList" :show-page="false" :table-params="tableParams">
        </zm-table-data>
        <Deduction v-if="tabValue === '1'"></Deduction>
        <goods-edit v-if="goodsEditParams.visible" v-model="goodsEditParams.visible" :obj="goodsEditParams.obj"></goods-edit>
      </div>
    </app-block>
  </app-container>
</template>

<script>
import tableMixin from '@/mixins/zmTableMixin'
import { expressionColumn, expressionTableData } from './const'
import Deduction from './components/Deduction'
import GoodsEdit from './components/Deduction/components/goodsExpressionEdit'

export default {
  name: 'Expression',
  components: { Deduction, GoodsEdit },
  mixins: [tableMixin],
  data () {
    return {
      columns: expressionColumn(this),
      tableData: expressionTableData(this),
      form: {

      },
      tabValue: '1',
      tabList: [
        {
          label: '逾期提成扣减',
          value: '1'
        },
        {
          label: '销售提成公式',
          value: '2'
        }
      ],
      goodsEditParams: {
        visible: false,
        obj: {}
      }
    }
  },
  computed: {},
  watch: {},
  created () { },
  methods: {
    loadList () { },
    onEdit (row) {
      // 订单类型：4包场，6 实物
      this.goodsEditParams = {
        visible: true,
        obj: row
      }
    }
  }
}
</script>
